<?php
	//打印数组
	function p($data)
	{
		echo '<pre>';
		print_r($data);	
	}
	
	//发布内容表情替换
	function replace_phiz($content)
	{
		preg_match_all('/\[.*?\]/is',$content,$arr);
		if($arr[0])
		{
			$phiz = F('phiz','','./Data/');
			foreach ($arr[0] as $v)			
			{
				foreach ($phiz as $key => $value)
				{
					if($v == '['.$value.']')	
					{
						$content = str_replace($v,'<img src="'.__ROOT__.'/Public/Images/phiz/'.$key.'.gif'.'"/>',$content);
					}
					continue;
				}	
			}
		}
		return $content;
	}
	
?>